<?php
/* @var $this UnitOfMeasuresController */
/* @var $dataProvider CActiveDataProvider */

$this->breadcrumbs=array(
    'Warehouse' => array('#'),
    'Inventory' => array('#'),
	'Master Data' => array('#'),
    'Unit Of Measures' => array('index'),
        //'Informasi Relasi SKP Terhadap SOP'=>array('#'),
);

?>


<div class="col-xs-12">
	<div class="page-content">
		<div class="page-header">
        	<?php
				Yii::app()->clientScript->registerScript('search', "
				$('.search-button').click(function(){
					$('.search-form').slideToggle('fast');
					return false;
				});
				$('.search-form form').submit(function(){
					$.fn.yiiGridView.update('suppliers-grid', {
						data: $(this).serialize()
					});
					return false;
				});
				");
			?>
            
            <?php 
				$this->beginWidget('zii.widgets.CPortlet', array(
					'htmlOptions'=>array(
						'class'=>''
					)
				));
				$this->widget('bootstrap.widgets.TbMenu', array(
					'type'=>'pills',
					'items'=>array(
						array('label'=>'Create', 'icon'=>'icon-plus', 'url'=>Yii::app()->controller->createUrl('create'), 'linkOptions'=>array()),
								array('label'=>'List', 'icon'=>'icon-th-list', 'url'=>Yii::app()->controller->createUrl('index'),'active'=>true, 'linkOptions'=>array()),
						array('label'=>'Search', 'icon'=>'icon-search', 'url'=>'#', 'linkOptions'=>array('class'=>'search-button')),
					),
				));
				$this->endWidget();
			?>
            
            <div class="search-form" style="display:none">
				<?php $this->renderPartial('_search',array(
                    'model'=>$model,
                )); ?>
			</div><!-- search-form -->
            
            <?php $this->widget('bootstrap.widgets.TbGridView',array(
				'id'=>'suppliers-grid',
				'dataProvider'=>$model->search(),
					'type'=>'striped bordered condensed',
					'template'=>'{summary}{pager}{items}{pager}',
				'columns'=>array(
					'unit_code',
					'description',
					
				   array(
						'class'=>'bootstrap.widgets.TbButtonColumn',
						'template' => '{view} {update} {delete}',
						'buttons' => array(
							  'view' => array(
								'label'=> 'View',
								'options'=>array(
									'class'=>'btn btn-small view'
								)
							),	
								'update' => array(
									'label'=> 'Update',
									'options'=>array(
										'class'=>'btn btn-small update'
								)
							),
							'delete' => array(
									'label'=> 'Delete',
									'options'=>array(
										'class'=>'btn btn-small delete'
								)
							),
							
						),
						'htmlOptions'=>array('style'=>'width: 105px'),
					   )//endarray tbgrid
				),//end array column
			)); 
		?>

        </div> <!-- end div page-header -->
	</div> <!-- end div page-content -->
</div> <!-- end div col-xs-12 -->
		
